<?php

/**
 * Zend_Controller_Front
 */
require_once('Zend/Controller/Front.php');

/**
 * BaseUrl helper
 *
 * @author Geoffrey Tran
 * @package Kysat_View
 * @subpackage Helper
 * @link http://www.spotsec.com
 */
class Kysat_View_Helper_BaseUrl
{
    /**
     * Returns site base url
     *
     * $file is appended to the base url for simplicity
     *
     * @param string $file
     * @return string
     */
    public function baseUrl($file = null)
    {
        return Zend_Controller_Front::getInstance()->getRequest()->getBaseUrl()
                . ($file ? ('/' . trim((string) $file, '/\\')) : '');
    }
}
